﻿

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;


public class BLL_tbl_rm_receipt
{
    public BLL_tbl_rm_receipt()
    {

    }

    public List<tbl_rm_receipt> select(int ID)
    {
        DAL_tbl_rm_receipt dal = new DAL_tbl_rm_receipt();
        return dal.select(ID);
    }

    public List<tbl_rm_receipt> selectAll()
    {
        DAL_tbl_rm_receipt dal = new DAL_tbl_rm_receipt();
        return dal.selectAll();
    }

    public DataTable selectAllForGrid()
    {
        DAL_tbl_rm_receipt dal = new DAL_tbl_rm_receipt();
        return dal.selectAllForGrid();
    }
    public bool insert(tbl_rm_receipt tbl)
    {
        DAL_tbl_rm_receipt dal = new DAL_tbl_rm_receipt();
        int i = 0;
        i = dal.insert(
            tbl.RM_Order_Number
, tbl.Quantity_Received
, tbl.Date
, tbl.Note
, tbl.Bag_Number
, tbl.Drum_Number
, tbl.CREATED_BY
, tbl.CREATED_DATE
        );

        return Convert.ToBoolean(i);
    }


    public bool update(tbl_rm_receipt tbl)
    {
        DAL_tbl_rm_receipt dal = new DAL_tbl_rm_receipt();
        int i = 0;
        i = dal.update(
            tbl.ID
, tbl.RM_Order_Number
, tbl.Quantity_Received
, tbl.Date
, tbl.Note
, tbl.Bag_Number
, tbl.Drum_Number
, tbl.UPDATED_BY
, tbl.UPDATED_DATE
            );

        return Convert.ToBoolean(i);
    }


    public bool delete(tbl_rm_receipt tbl)
    {
        DAL_tbl_rm_receipt dal = new DAL_tbl_rm_receipt();
        int i = 0;
        i = dal.delete(
                tbl.ID
        );

        return Convert.ToBoolean(i);
    }

   public DataTable getBagAndDrumLastNum( string rmnumber)
    {
        DAL_tbl_rm_receipt dal = new DAL_tbl_rm_receipt();
        return dal.getBagAndDrumLastNum( rmnumber);
    }

   public List<tbl_rm_receipt> getBagNumForDll(string RMONumber)
   {
       DAL_tbl_rm_receipt dal = new DAL_tbl_rm_receipt();
       return dal.getBagNumForDll(RMONumber);
   }

 
}

